import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';

import 'app.dart';
import 'loading.dart';

void main() {
  runApp(
    MaterialApp(
      theme: mDefaultTheme,
      debugShowCheckedModeBanner: false,
      routes: {
        "/app": (BuildContext context) => App(),
        "/company_info": (BuildContext context) => WebviewScaffold(
              url: "https://www.baidu.com",
              appBar: AppBar(
                title: Text("公司简介"),
                leading: IconButton(
                  icon: Icon(Icons.home),
                  onPressed: () {
                    Navigator.of(context).pushReplacementNamed("/app");
                  },
                ),
              ),
            ),
      },
      home: LoadingPage(),
    ),
  );
}

final ThemeData mDefaultTheme = ThemeData(primaryColor: Colors.redAccent);
